<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    


<script>
    // let arr = [100,     200,    300,400,500]
    //         chinese  math    english

    // let chinese = arr[0]
    // let math = arr[1]
    // let english = arr[2]

    // console.log(chinese)
    // console.log(math)
    // console.log(english)

    // console.log(arr)

    // 解构赋值
    // 使用相同类型的值
    let [chinese, math, english] = [100,200,300,400,500]

    console.log(chinese)
    console.log(math)
    console.log(english)


    let [a,b,c,d,f] = '12345'

    console.log(a);
    console.log(b);
    console.log(c);
    console.log(d);
    console.log(f);


    // 解构对象
    // 解构出来的别名，尽量与对象中的属性名一致
    let {name, age, height} = {
        name: 'tom',
        age: 18,
        height: 180
    }

    console.log(name);
    console.log(age);
    console.log(height);


</script>


</body>
</html>